j3deditor.bin.hierarchy.util
Class ObjImporter

java.lang.Object
  extended by javax.swing.SwingWorker<java.lang.Void,java.lang.Void>
      extended by j3deditor.bin.hierarchy.util.HierarchyWorker
          extended by j3deditor.bin.hierarchy.util.ObjImporter
All Implemented Interfaces:
java.lang.Runnable, java.util.concurrent.Future<java.lang.Void>, java.util.concurrent.RunnableFuture<java.lang.Void>

public class ObjImporter
extends HierarchyWorker

Tool for importing objects from OBJ file to specified scene. Uses com.sun.j3d.loaders.objectfile.ObjectFile.

Author:
Risto Seene
See Also:
ObjectFile

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.SwingWorker
javax.swing.SwingWorker.StateValue
 
Constructor Summary
ObjImporter(J3DeScene scene)
          Creates an instance of ObjLoader which is able to import objects to the given scene.
 
Method Summary
protected  java.lang.Void doInBackground()
          Performes the importation process in a background thread.
protected  void done()
          Notifies all listeners that object(s) have been added to the scene.
 void loadFile(java.lang.String filePath)
          Opens the given OBJ file and imports objects to the scene associated to this importer.
 
Methods inherited from class j3deditor.bin.hierarchy.util.HierarchyWorker
addHierarchyListener, notifyListeners, removeHierarchyListener
 
Methods inherited from class javax.swing.SwingWorker
addPropertyChangeListener, cancel, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, process, publish, removePropertyChangeListener, run, setProgress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjImporter

public ObjImporter(J3DeScene scene)
Creates an instance of ObjLoader which is able to import objects to the given scene.

Parameters:
scene - an instance of J3DeScene this importer can import to
Method Detail

loadFile

public void loadFile(java.lang.String filePath)
Opens the given OBJ file and imports objects to the scene associated to this importer.

Parameters:
filePath - path of a OBJ file the objects will be imported from
See Also:
ObjectFile.load(String filePath)

doInBackground

protected java.lang.Void doInBackground()
                                 throws java.lang.Exception
Performes the importation process in a background thread.

Overrides:
doInBackground in class HierarchyWorker
Returns:
nothing
Throws:
java.lang.Exception - if unable to import
See Also:
SwingWorker.doInBackground()

done

protected void done()
Notifies all listeners that object(s) have been added to the scene.

Overrides:
done in class javax.swing.SwingWorker<java.lang.Void,java.lang.Void>